<?php
include("include/config.inc.php");
$i = 0;
$incomingId     = isset($_REQUEST['incomingId']) ? $_REQUEST['incomingId'] : 0;
$isEdit            = 0;   

if(isset($_POST['submitBtn']))
{
	  $temp1      =  (isset($_POST['temp1'])) && ($_POST['temp1'] != "") ? $_POST['temp1'] : 0 ;
	  $temp2      =  (isset($_POST['temp2'])) && ($_POST['temp2'] != "") ? $_POST['temp2'] : 0 ;
	  $temp3      =  (isset($_POST['temp3'])) && ($_POST['temp3'] != "") ? $_POST['temp3'] : 0 ;
    $soaking1   =  (isset($_POST['soaking1'])) && ($_POST['soaking1'] != "") ? $_POST['soaking1'] : 0 ;
    $soaking2   =  (isset($_POST['soaking2'])) && ($_POST['soaking2'] != "") ? $_POST['soaking2'] : 0 ;
    $soaking3   =  (isset($_POST['soaking3'])) && ($_POST['soaking3'] != "") ? $_POST['soaking3'] : 0 ;
    $furnace1   =  (isset($_POST['furnace1'])) && ($_POST['furnace1'] != "") ? $_POST['furnace1'] : 0 ;
    $furnace2   =  (isset($_POST['furnace2'])) && ($_POST['furnace2'] != "") ? $_POST['furnace2'] : 0 ;
    $furnace3   =  (isset($_POST['furnace3'])) && ($_POST['furnace3'] != "") ? $_POST['furnace3'] : 0 ;
    
  if(isset($_POST['incomingId']) && $_POST['incomingId'] > 0)
  {
  echo  $updateincoming = "UPDATE incoming
                            SET incomingId     = '".$incomingId."',
                                temp1         = '".$_POST['temp1']."',
                                soaking1      = '".$_POST['soaking1']."',
	                              furnace1      = '".$_POST['furnace1']."',
	                              temp2         = '".$_POST['temp2']."',
	                              soaking2      = '".$_POST['soaking2']."',
	                              furnace2      = '".$_POST['furnace2']."',
	                              temp3         = '".$_POST['temp3']."',
	                              furnace3      = '".$_POST['furnace3']."',
	                              furnace3      = '".$_POST['furnace3']."',
	                        WHERE incomingId    ss= ".$_REQUEST['incomingId'];
    $updateRojmelResult = mysql_query($updateRojmel);
    if(!$updateRojmelResult)
    {
      die("Update Query Not Inserted : ".mysql_error());
    }
    else
    {
      header("Location:planingList.php");  
    }
  }
}
$smarty->display("planingEdit.tpl");
$smarty->assign("isEdit",$isEdit);  
?>